package qing.entity;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.NotBlank;

@Entity
@Table
public class Tpl  extends AbstractEntity<String> {

	@Override
	public String toString() {
		return "Tpl [id=" + id + ", version=" + version + ", deleted=" + deleted + ", dateCreated=" + dateCreated
				+ ", title=" + title + ", fileaddr=" + fileaddr + ", filetype=" + filetype + ", ismobile=" + ismobile
				+ ", isdefault=" + isdefault + ", txtnr=" + txtnr + ", adduser=" + adduser + ", lasttime=" + lasttime
				+ "]";
	}


	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	private String id;	
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	//貌似解决并发控制数据问题
	@Version
	private Integer version;
	
	private boolean deleted;
	
	//时间戳
	    @Column(updatable = false)
		@Temporal(value=TemporalType.TIMESTAMP)
		private Date dateCreated=new Date();;
		
		@NotBlank
		private String title;
		
		private String fileaddr;
		
		private int filetype;
		
		private int ismobile;
		
		private Boolean isdefault=false;
		
		private String txtnr;
		
		
				
		
		@Column(updatable = false)
		private String adduser;		
		
		
		@Temporal(value=TemporalType.TIMESTAMP)
		private Date lasttime=new Date();



		public Integer getVersion() {
			return version;
		}

		public void setVersion(Integer version) {
			this.version = version;
		}

		public boolean isDeleted() {
			return deleted;
		}

		public void setDeleted(boolean deleted) {
			this.deleted = deleted;
		}

		public Date getDateCreated() {
			return dateCreated;
		}

		public void setDateCreated(Date dateCreated) {
			this.dateCreated = dateCreated;
		}

		public String getTitle() {
			return title;
		}

		public void setTitle(String title) {
			this.title = title;
		}

		public String getFileaddr() {
			return fileaddr;
		}

		public void setFileaddr(String fileaddr) {
			this.fileaddr = fileaddr;
		}

		public int getFiletype() {
			return filetype;
		}

		public void setFiletype(int filetype) {
			this.filetype = filetype;
		}

		public int getIsmobile() {
			return ismobile;
		}

		public void setIsmobile(int ismobile) {
			this.ismobile = ismobile;
		}



		public String getAdduser() {
			return adduser;
		}

		public void setAdduser(String adduser) {
			this.adduser = adduser;
		}

	
		public Date getLasttime() {
			return lasttime;
		}

		public void setLasttime(Date lasttime) {
			this.lasttime = lasttime;
		}

		public String getTxtnr() {
			return txtnr;
		}

		public void setTxtnr(String txtnr) {
			this.txtnr = txtnr;
		}

		public Boolean getIsdefault() {
			return isdefault;
		}


		public void setIsdefault(Boolean isdefault) {
			this.isdefault = isdefault;
		}


	
	
	
}
